from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.dml.color import RGBColor
import os
from config import SLIDE_CONFIG

def create_analysis_report(data, output_path):
    """生成PPT分析报告"""
    prs = _init_deck()
    _add_title_slide(prs)
    
    for q in data['questions']:
        slide = _add_question_slide(prs)
        _build_slide_content(slide, q, data['merged_ranges'])
        
    _save_deck(prs, output_path)

def _init_deck():
    prs = Presentation()
    prs.slide_width = SLIDE_CONFIG['WIDTH']
    prs.slide_height = SLIDE_CONFIG['HEIGHT']
    return prs

# ... (其他辅助函数保持相似结构，从原代码迁移) ...